{% extends "adposting/view.html" %}  
{% comment %}
  $Id$
{% endcomment %}

{% load humanize %}
{% block ad %}

<div class="head">
 <span id="jobId">Ad Id : {{ ad.pk }}</span>
 <h2 style="margin: 0px; font-size: 16px;">{{ ad.title }}</h2>
  <h3>Business Type: {{ ad.fields_dict.businesstype }}</h3>
  <h4>Location: {% if ad.fields_dict.city %}{{ ad.fields_dict.city }}{% endif %} {{ ad.fields_dict.location }}</h4>
</div>

<p id="aboveSidebarView">Posted On : {{ ad.created_on|date:"F dS, Y" }}</p>


 <p>Asking Price : ${{ ad.fields_dict.price|intcomma }}</p>

<div id="sidebarView">
 <p class="head">Contact Information</p>
 <p>{{ ad.fields_dict.contactname }}</p>
 <p>{% if ad.fields_dict.city %}{{ ad.fields_dict.city }}{% endif %} {{ ad.fields_dict.location }}</p>
 <p>{{ ad.fields_dict.phone }}</p>
 <p>{{ ad.fields_dict.contactcompanyname }}</p>
 <p><a href="http://www.{{ ad.fields_dict.website }}" target="_blank">{{ ad.fields_dict.website|slice:":26" }}</a></p>
 <p><a href="{% url contact.views.contact_ad ad.pk %}"><img src="{{ MEDIA_URL }}images/sellerButton.png"  alt="Contact" /></a></p>
 <ul class="head">
  <li><a href="javascript:window.print();">Print This Ad</a></li>
  <li><a href="javascript:;" onclick="window.location.href='mailto:?body=&quot;http://{{ site.domain }}/ads/{{ ad.pk }}&quot;';">Tell a Friend</a></li>
  <li><a target="_blank" href="http://maps.google.com/maps?q={% if ad.fields_dict.city %}{{ ad.fields_dict.city }}{% endif %} {{ ad.fields_dict.location }}">Map this Listing</a></li>
 </ul>
</div>

 
<div id="jobContent">
 <h3>Description :</h3>
  {{ ad.fields_dict.description|safe }}
</div>

 <div class="images">
 {% for image in ad.adimage_set.all %}
  {% if image.get_thumb_photo_url %}
   <a href="{{ image.get_full_photo_url }}"><img src="{{ image.get_thumb_photo_url }}" alt="Thumbnail" class="thumbnail" /></a>
  {% endif %}
 {% endfor %}
 </div>
{% endblock %}
